package com.pwser.dao;

import java.util.List;

import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import com.pwser.entity.User;

public interface UserMapper {
	@Select("SELECT USER_ID AS USERID, USER_NAME AS USERNAME FROM SHIRO_USER WHERE USER_NAME = #{userName}")
	public User findByName(String userName);

	@Insert("INSERT INTO SHIRO_USER(USER_ID, USER_NAME) VALUES(#{userId}, #{userName})")
	public int insert(@Param("userId") Integer userId, @Param("userName") String userName);
	
	@Select("SELECT USER_ID AS USERID, USER_NAME AS USERNAME FROM SHIRO_USER")
    public List<User> getAllUsers();
	
}
